Repository navigation
fix(gateway): reject any gateway node's key on every node - #1604
Merged
Merged
Conversation
kvinwang
enabled auto-merge
November 18, 2026 08:46
Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
fix/gateway-reject-gateway-keys
branch
from
November 18, 2026 10:03
962e630 to
ce8f543
Compare
kvinwang
added a commit
that referenced
this pull request
Nov 18, 2026
Import follows #1604: a record carrying any replicated gateway key, or the judging node's own, is rejected as LostConflict on every node. Nodes with equal KV contents now agree once their own keys have replicated; the window before that is kept as a counterexample. Key squatting is added: a counterexample without proof of possession, and stable key binding under the hypothesis that every record was registered by its key's holder (#1615, modeled abstractly). IpAlloc follows #1605: release_ip frees an address only when no other instance holds it. Registration, rebuild, forget and KV reload are modeled, and alloc_ip never reissues a live address, including one a conflict loser shares during its grace period. PoolsClear stays an assumption; #1606 only warns. Signed-off-by: Kevin Wang <wy721@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Import compared an instance record's WireGuard key only with this node's own key, and registration checked no gateway key at all. A CVM could register on node A with node B's key: every node accepted the record except B, so the nodes disagreed on which instances exist.
accept_instancesnow also takes the gateway keys from the replicatednode/inforecords (KvStore::gateway_wg_public_keys), and a record carrying one loses on every node; registration refuses such keys too. The instance reload also wakes onnode/changes, so learning a peer's key later updates the decision.No format change; only bogus records are affected. Found by the Lean model of import (#1597,
IpAlloc.lean,gateway_key_record_diverges).